package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);
        fos.write("爱你孤身走暗巷".getBytes(StandardCharsets.UTF_8));
        fos.write("爱你不跪的模样".getBytes(StandardCharsets.UTF_8));
        fos.close();
/*        String line =  "还记得你说家是唯一的城堡，随着稻香河流继续奔跑";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        line = "微微笑，小时的梦我知道";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完毕");
        fos.close();*/
    }
}
